class TopicReply < ActiveRecord::Base
  belongs_to :user
  belongs_to :topic, :counter_cache => true
  
  validates_presence_of     :content, :message => "内容不能为空"
  
  def before_save
    self.title = self.title.gsub(/^\<(script|frame)/i, '')
    self.content = self.content.gsub(/^\<(script|frame)/i, '')
  end
end
